//package com.dqyt.quart;
//
//import lombok.extern.slf4j.Slf4j;
//import org.quartz.Scheduler;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
//
///**
// * @version 1.0
// * @author jinhaoxun
// * @date 2018-05-09
// * @description Quartz配置
// */
//@Slf4j
//@Configuration
//public class QuartzConfig {
//
//    private JobFactory jobFactory;
//
//    /**
//     * @author jinhaoxun
//     * @description 构造器
//     * @param jobFactory
//     */
//    public QuartzConfig(JobFactory jobFactory){
//        this.jobFactory = jobFactory;
//    }
//
//    /**
//     * @author  jinhaoxun
//     * @description 配置SchedulerFactoryBean，将一个方法产生为Bean并交给Spring容器管理
//     * @return SchedulerFactoryBean
//     */
//    @Bean
//    public SchedulerFactoryBean schedulerFactoryBean() {
//        log.info("开始注入定时任务调度器工厂...");
//        SchedulerFactoryBean factory = new SchedulerFactoryBean();// Spring提供SchedulerFactoryBean为Scheduler提供配置信息,并被Spring容器管理其生命周期
//        factory.setJobFactory(jobFactory);// 设置自定义Job Factory，用于Spring管理Job bean
//        log.info("注入定时任务调度器工厂成功！");
//        return factory;
//    }
//
//    @Bean(name = "scheduler")
//    public Scheduler scheduler() {
//        return schedulerFactoryBean().getScheduler();
//    }
//}
